﻿@model int?
<input id="autocomplete">
@Html.HiddenFor(m => m, new { @class = "locationautocomplete" })
<script>
    $("#autocomplete").autocomplete({
        autoFocus: true,
        minLength: 2,
        source: "/Locations/get",
        select: function (event, ui) {
            $(".locationautocomplete").val(ui.item.id); 
        }
    });
</script>